Newcastle maintained their lead at the top of the Championship, as Wigan made them battle for a first win in four.